package com.stgy.lease.web.api.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.stgy.lease.common.result.Result;
import com.stgy.lease.web.api.dto.BaseSearchDto;
import com.stgy.lease.web.api.service.BrowsingHistoryService;
import com.stgy.lease.web.api.vo.HistoryItemVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName:HistoryController
 * Package:com.stgy.lease.web.api.controller
 * Description:
 *
 * @Author:helei
 * @Create:2024/9/6 - 15:24
 */
@RestController
@RequestMapping("/app/history")
@Tag(name = "浏览历史管理")
public class HistoryController {

    @Autowired
    private BrowsingHistoryService browsingHistoryService;

    //http://localhost:8888/app/history/pageItem?current=1&size=10 GET
    @Operation(summary = "分页查询浏览记录")
    @GetMapping("/pageItem")
    public Result<Page<HistoryItemVo>> pageItem(BaseSearchDto searchDto){
        return Result.ok(browsingHistoryService.pageItem(searchDto));
    }

}